unit GridLista;

interface

uses
  System.SysUtils, System.Classes, Vcl.Controls, Vcl.Grids, Vcl.DBGrids,
  System.Types;

type
  TGridLista = class(TDBGrid)
  private
    { Private declarations }
    FRowHeight: Integer;
  protected
    { Protected declarations }
    procedure SetRowHeight(const Value: Integer);
  public
    { Public declarations }
    function CellRect(ACol, Arow: LongInt): TRect; Reintroduce;
    property Row;
    property Col;
  published
    { Published declarations }
    property RowHeight: Integer read FRowHeight write SetRowHeight;
  end;

procedure Register;

implementation

uses
  Winapi.Messages;

{ TGridLista }
function TGridLista.CellRect(ACol, Arow: LongInt): TRect;
begin
  Result := Inherited CellRect(ACol, Arow);
end;

procedure TGridLista.SetRowHeight(const Value: Integer);
begin
  if (FRowHeight <> Value) then
  begin
    FRowHeight := Value;
    DefaultRowHeight := FRowHeight;
    if (DataLink.Active) then
    begin
      Perform(WM_SIZE, 0, 0);
    end;
  end;
end;

procedure Register;
begin
  RegisterComponents('SwSoftware', [TGridLista]);
end;

end.
